package com.gel.shortLink.admin.config;


import org.redisson.api.RBloomFilter;
import org.redisson.api.RedissonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/*布隆过滤器*/
@Configuration
public class RBloomFilterConfiguration {

    @Bean
    public RBloomFilter<String> userRegisterCachePenetrationBloomFilter(RedissonClient redissonClient) {
        RBloomFilter<String> userRegisterCachePenetrationBloomFilter = redissonClient.getBloomFilter("userRegisterCachePenetrationBloomFilter");
        userRegisterCachePenetrationBloomFilter.tryInit(100000000L,0.001);//存储元素数量和误判率
        return  userRegisterCachePenetrationBloomFilter;
    }
}
